package Map;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.function.BiConsumer;

public class aaa {
    public static void main(String[] args) {

        String s="aaaaabbbbcccdde";
        TreeMap<Character, Integer> tm = new TreeMap<>();
        tm.put('a',2);
        tm.put('b',3);
        tm.forEach((key, value) -> {
            System.out.println(key+"="+value);

        });
      /*tm.forEach(new BiConsumer<Character, Integer>() {
          @Override
          public void accept(Character character, Integer integer) {
              System.out.println(character+" "+integer);
          }
      });*/
      /*  System.out.println();*/
       /* for(int i=0;i<s.length();i++){
            char c=s.charAt(i);
            if(tm.containsKey(c)){
                int count=tm.get(c);
            *//*    System.out.println(count);*//*
                count++;
                tm.put(c, count);

            }else{
                tm.put(c, 1);
            }
        }
        System.out.println(tm);*/
        /*Map<String, String> m = new HashMap<>();
        m.put("guojing", "huangrong");
        m.put("weiixoabao","mujinaping");

        m.forEach(new BiConsumer<String, String>() {
            @Override
            public void accept(String s, String s2) {
                System.out.println(s+"="+s2);
            }
        });*/

       /* Set<Map.Entry<String, String>> entries = m.entrySet();
        for (Map.Entry<String, String> entry : entries) {
            String key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key+"="+value);
        }
*/
       /* Set<String> keys = m.keySet();
        for (String key : keys) {
           // System.out.println(key);
            String value = m.get(key);
            System.out.println(key + "=" + value);
        }*/


       /* String ss = m.put("weiixoabao", "weoix");
        System.out.println(ss);
        System.out.println(m);*/
    }
}
